package org.example.lambda;

import org.example.entity.Person;

import java.util.Arrays;
import java.util.List;

/**
 * @author why
 * @date 2022/11/1511:26
 */
public class CollectionIterationExample {


    public static void main(String[] args) {
        List<Person> personList = Arrays.asList(
                new Person("Cheng1","fen",23),
                new Person("Cheng2","fen",23),
                new Person("Xiao","Can",23),
                new Person("Chang3","yang",23),
                new Person("Clin","Yang",23),
                new Person("Lin","Cang",23)
        );
//
//
//        for (int i = 0; i < personList.size(); i++) {
//            System.out.println(personList.get(i));
//        }
//
//
//
//        for(Person person:personList){
//            System.out.println(person);
//        }
//
//
        personList.forEach(System.out::println);














    }



}
